import React from 'react'
import { Redirect } from "react-router-dom"
export default function BeforeEach(props) {
    const Com = props.component
    return (
        <>
            {
                props.isLogin && !localStorage.getItem("token") ? <Redirect to="/login" /> : <Com {...props} />
            }

        </>
    )
}
